home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Addition / card_4314.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  9.4 KB  |  434 lines

  1. -- card: 4314 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3967
  5. -- name: 
  6.  
  7.  
  8. -- part 6 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=355 top=161 right=194 bottom=388
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: 7
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   get the length of field "Sum"
  23.   if it is 2 then exit mouseUp
  24.   add 1 to it
  25.   put "7" into char it of field "Sum"
  26. end mouseUp
  27.  
  28.  
  29.  
  30. -- part 7 (button)
  31. -- low flags: 00
  32. -- high flags: 8003
  33. -- rect: left=395 top=161 right=194 bottom=427
  34. -- title width / last selected line: 0
  35. -- icon id / first selected line: 0 / 0
  36. -- text alignment: 1
  37. -- font id: 0
  38. -- text size: 12
  39. -- style flags: 0
  40. -- line height: 16
  41. -- part name: 8
  42. ----- HyperTalk script -----
  43. on mouseUp
  44.   get the length of field "Sum"
  45.   if it is 2 then exit mouseUp
  46.   add 1 to it
  47.   put "8" into char it of field "Sum"
  48. end mouseUp
  49.  
  50.  
  51.  
  52. -- part 8 (button)
  53. -- low flags: 00
  54. -- high flags: 8003
  55. -- rect: left=435 top=162 right=194 bottom=467
  56. -- title width / last selected line: 0
  57. -- icon id / first selected line: 0 / 0
  58. -- text alignment: 1
  59. -- font id: 0
  60. -- text size: 12
  61. -- style flags: 0
  62. -- line height: 16
  63. -- part name: 9
  64. ----- HyperTalk script -----
  65. on mouseUp
  66.   get the length of field "Sum"
  67.   if it is 2 then exit mouseUp
  68.   add 1 to it
  69.   put "9" into char it of field "Sum"
  70. end mouseUp
  71.  
  72.  
  73.  
  74. -- part 9 (button)
  75. -- low flags: 00
  76. -- high flags: 8003
  77. -- rect: left=356 top=201 right=233 bottom=389
  78. -- title width / last selected line: 0
  79. -- icon id / first selected line: 0 / 0
  80. -- text alignment: 1
  81. -- font id: 0
  82. -- text size: 12
  83. -- style flags: 0
  84. -- line height: 16
  85. -- part name: 4
  86. ----- HyperTalk script -----
  87. on mouseUp
  88.   get the length of field "Sum"
  89.   if it is 2 then exit mouseUp
  90.   add 1 to it
  91.   put "4" into char it of field "Sum"
  92. end mouseUp
  93.  
  94.  
  95.  
  96. -- part 10 (button)
  97. -- low flags: 00
  98. -- high flags: 8003
  99. -- rect: left=395 top=202 right=234 bottom=428
  100. -- title width / last selected line: 0
  101. -- icon id / first selected line: 0 / 0
  102. -- text alignment: 1
  103. -- font id: 0
  104. -- text size: 12
  105. -- style flags: 0
  106. -- line height: 16
  107. -- part name: 5
  108. ----- HyperTalk script -----
  109. on mouseUp
  110.   get the length of field "Sum"
  111.   if it is 2 then exit mouseUp
  112.   add 1 to it
  113.   put "5" into char it of field "Sum"
  114. end mouseUp
  115.  
  116.  
  117.  
  118. -- part 11 (button)
  119. -- low flags: 00
  120. -- high flags: 8003
  121. -- rect: left=435 top=201 right=233 bottom=466
  122. -- title width / last selected line: 0
  123. -- icon id / first selected line: 0 / 0
  124. -- text alignment: 1
  125. -- font id: 0
  126. -- text size: 12
  127. -- style flags: 0
  128. -- line height: 16
  129. -- part name: 6
  130. ----- HyperTalk script -----
  131. on mouseUp
  132.   get the length of field "Sum"
  133.   if it is 2 then exit mouseUp
  134.   add 1 to it
  135.   put "6" into char it of field "Sum"
  136. end mouseUp
  137.  
  138.  
  139.  
  140. -- part 12 (button)
  141. -- low flags: 00
  142. -- high flags: 8003
  143. -- rect: left=356 top=242 right=274 bottom=389
  144. -- title width / last selected line: 0
  145. -- icon id / first selected line: 0 / 0
  146. -- text alignment: 1
  147. -- font id: 0
  148. -- text size: 12
  149. -- style flags: 0
  150. -- line height: 16
  151. -- part name: 1
  152. ----- HyperTalk script -----
  153. on mouseUp
  154.   get the length of field "Sum"
  155.   if it is 2 then exit mouseUp
  156.   add 1 to it
  157.   put "1" into char it of field "Sum"
  158. end mouseUp
  159.  
  160.  
  161.  
  162. -- part 13 (button)
  163. -- low flags: 00
  164. -- high flags: 8003
  165. -- rect: left=395 top=241 right=273 bottom=428
  166. -- title width / last selected line: 0
  167. -- icon id / first selected line: 0 / 0
  168. -- text alignment: 1
  169. -- font id: 0
  170. -- text size: 12
  171. -- style flags: 0
  172. -- line height: 16
  173. -- part name: 2
  174. ----- HyperTalk script -----
  175. on mouseUp
  176.   get the length of field "Sum"
  177.   if it is 2 then exit mouseUp
  178.   add 1 to it
  179.   put "2" into char it of field "Sum"
  180. end mouseUp
  181.  
  182.  
  183.  
  184. -- part 14 (button)
  185. -- low flags: 00
  186. -- high flags: 8003
  187. -- rect: left=436 top=242 right=274 bottom=468
  188. -- title width / last selected line: 0
  189. -- icon id / first selected line: 0 / 0
  190. -- text alignment: 1
  191. -- font id: 0
  192. -- text size: 12
  193. -- style flags: 0
  194. -- line height: 16
  195. -- part name: 3
  196. ----- HyperTalk script -----
  197. on mouseUp
  198.   get the length of field "Sum"
  199.   if it is 2 then exit mouseUp
  200.   add 1 to it
  201.   put "3" into char it of field "Sum"
  202. end mouseUp
  203.  
  204.  
  205.  
  206. -- part 15 (button)
  207. -- low flags: 00
  208. -- high flags: 8003
  209. -- rect: left=355 top=281 right=313 bottom=407
  210. -- title width / last selected line: 0
  211. -- icon id / first selected line: 0 / 0
  212. -- text alignment: 1
  213. -- font id: 0
  214. -- text size: 12
  215. -- style flags: 0
  216. -- line height: 16
  217. -- part name: 0
  218. ----- HyperTalk script -----
  219. on mouseUp
  220.   get the length of field "Sum"
  221.   if it is 2 then exit mouseUp
  222.   add 1 to it
  223.   put "0" into char it of field "Sum"
  224. end mouseUp
  225.  
  226.  
  227.  
  228. -- part 18 (button)
  229. -- low flags: 00
  230. -- high flags: 8003
  231. -- rect: left=354 top=102 right=139 bottom=468
  232. -- title width / last selected line: 0
  233. -- icon id / first selected line: 0 / 0
  234. -- text alignment: 1
  235. -- font id: 0
  236. -- text size: 12
  237. -- style flags: 0
  238. -- line height: 16
  239. -- part name: Next Problem
  240. ----- HyperTalk script -----
  241. on mouseUp
  242.   if field "Flag" = 0 then exit mouseUp
  243.   show button "Smiley"
  244.   show button "Frowney"
  245.   put empty into field "Comment"
  246.   put "  " into field "Addend1"
  247.   put "  " into field "Addend2"
  248.   put empty into field "Sum"
  249.   if field "Attempts" = second word of bkgnd field "Options" then
  250.  
  251.     put field "Attempts" into attempts
  252.     put field "Correct" into correct
  253.     put field "Percent" into percent
  254.     put field "Name" into name
  255.     put third word of field "Options" into skill
  256.     put "O" into field "Attempts"
  257.     put "O" into field "Correct"
  258.     put "O" into field "Percent"
  259.     set the lockScreen to true
  260.     set the cursor to 4
  261.     go to first card of bkgnd "Users"
  262.     rotateData
  263.     put name into line 1 of field "name"
  264.     put the date into line 1 of field "Date"
  265.     put skill into line 1 of field "Skill"
  266.     put attempts into line 1 of field "Attempts"
  267.     put correct into line 1 of field "Correct"
  268.     put percent into line 1 of field "Percent"
  269.     pop card
  270.     exit mouseUp
  271.   end if
  272.   get the random of 9
  273.   put it into char 2 of field "Addend1"
  274.   get the random of 10
  275.   subtract 1 from it
  276.   put it into char 2 of field "Addend2"
  277.   put field "Addend1" into answer
  278.   add field "Addend2" to answer
  279.   if answer < 10 then put " " into field "Sum"
  280.   put "0" into field "Flag"
  281. end mouseUp
  282.  
  283. on rotateData
  284.   repeat with x = 11 down to 1
  285.     if line x of field "Name" is empty then next repeat
  286.     put x into nextLine
  287.     add 1 to nextLine
  288.     get line x of field "Name"
  289.     put it into line nextLine of field "Name"
  290.     get line x of field "Date"
  291.     put it into line nextLine of field "Date"
  292.     get line x of field "Skill"
  293.     put it into line nextLine of field "Skill"
  294.     get line x of field "Attempts"
  295.     put it into line nextLine of field "Attempts"
  296.     get line x of field "Correct"
  297.     put it into line nextLine of field "Correct"
  298.     get line x of field "Percent"
  299.     put it into line nextLine of field "Percent"
  300.   end repeat
  301. end rotateData
  302.  
  303.  
  304.  
  305.  
  306. -- part 19 (button)
  307. -- low flags: 00
  308. -- high flags: 8003
  309. -- rect: left=414 top=281 right=313 bottom=468
  310. -- title width / last selected line: 0
  311. -- icon id / first selected line: 0 / 0
  312. -- text alignment: 1
  313. -- font id: 0
  314. -- text size: 12
  315. -- style flags: 0
  316. -- line height: 16
  317. -- part name: Enter
  318. ----- HyperTalk script -----
  319. on mouseUp
  320.   global answer
  321.   if field "SUM" < 1 then exit mouseUp
  322.   if field "Flag" > 0 then exit mouseUp
  323.   put field "Addend1" into answer
  324.   add field "Addend2" to answer
  325.   add 1 to field "Attempts"
  326.   if field "Sum" = answer then
  327.     add 1 to field "Correct"
  328.     get field "Correct"
  329.     divide it by field "Attempts"
  330.     multiply it by 100
  331.     put round(it) into field "Percent"
  332.     celebrate
  333.   else
  334.     get field "Correct"
  335.     divide it by field "Attempts"
  336.     multiply it by 100
  337.     put round(it) into field "Percent"
  338.     nag
  339.   end if
  340. end mouseUp
  341.  
  342. on celebrate
  343.   put "Correct" into line 1 of field "Comment"
  344.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  345.   hide button "Smiley"
  346.   put "1" into field "Flag"
  347.   if first word of bkgnd field "Options" = "Y" then
  348.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  349.   end if
  350. end celebrate
  351.  
  352. on nag
  353.   global answer
  354.   put "WRONG!" into line 1 of field "Comment"
  355.   put "The answer is "& answer & "." into line 3 of field "Comment"
  356.   hide button "Frowney"
  357.   put "2" into field "Flag"
  358.   if first word of bkgnd field "Options" = "Y" then
  359.     play "boing" tempo 200 "gq c e a"
  360.   end if
  361. end nag
  362.  
  363.  
  364.  
  365. -- part 23 (button)
  366. -- low flags: 00
  367. -- high flags: 0001
  368. -- rect: left=21 top=87 right=180 bottom=121
  369. -- title width / last selected line: 0
  370. -- icon id / first selected line: 0 / 0
  371. -- text alignment: 1
  372. -- font id: 0
  373. -- text size: 12
  374. -- style flags: 0
  375. -- line height: 16
  376. -- part name: Smiley
  377.  
  378.  
  379. -- part 24 (button)
  380. -- low flags: 80
  381. -- high flags: 0001
  382. -- rect: left=234 top=87 right=180 bottom=334
  383. -- title width / last selected line: 0
  384. -- icon id / first selected line: 0 / 0
  385. -- text alignment: 1
  386. -- font id: 0
  387. -- text size: 12
  388. -- style flags: 0
  389. -- line height: 16
  390. -- part name: Frowney
  391.  
  392.  
  393. -- part contents for background part 1
  394. ----- text -----
  395.  8
  396.  
  397. -- part contents for background part 2
  398. ----- text -----
  399.  9
  400.  
  401. -- part contents for background part 5
  402. ----- text -----
  403. 1
  404.  
  405. -- part contents for background part 6
  406. ----- text -----
  407. 0
  408.  
  409. -- part contents for background part 7
  410. ----- text -----
  411. 0
  412.  
  413. -- part contents for background part 9
  414. ----- text -----
  415. 2
  416.  
  417. -- part contents for background part 14
  418. ----- text -----
  419. Y 10 1
  420.  
  421. -- part contents for background part 15
  422. ----- text -----
  423. ssss
  424.  
  425.  
  426. -- part contents for background part 3
  427. ----- text -----
  428. 74
  429.  
  430. -- part contents for background part 10
  431. ----- text -----
  432. WRONG!
  433.  
  434. The answer is 17.